<?php

namespace App\Services;

use App\Exceptions\BusinessException;
use App\Models\Company;

class CompanyService extends BaseService
{
    /**
     * 公司信息
     * @return array
     * @throws BusinessException
     */
    public function info()
    {
        // 获取数据
        $data = Company::query()->first(['id', 'company_name', 'company_desc', 'company_tel', 'privacy_agree']);
        if (!$data) {
            $this->throwBusinessException('公司不存在');
        }
        $data = $data->toArray();

        return $data;
    }
}
